%ic = [ 364 259; 374, 329; 517, 182;];
ic = [145 232; 399 491; 662 302;];
ic = [ic(:,1)'; ic(:,2)'];
%pc = [61.671673134 61.649622442 61.696827728; 10.103171831 10.109937117 10.208527744];
pc=[61.919367341 61.878572786 61.835215548; 9.70741801 9.796619732 9.731496619];
A = [];
p = [];
for i=1:size(ic,2)
	A = [ A; 
			ic(1,i) ic(2,i) 1 0 0 0; 
			0 0 0 ic(1,i) ic(2,i) 1 
		 ]
	p = [ p; 
			pc(1,i);
			pc(2,i) 
		 ];
end

a = A'*A\A'*p;

M = [a(1) a(2) a(3); a(4) a(5) a(6) ]


%# names for waypoints
%[waypoints]
%RONDSLOTTE
%#Lat: 61.914963825 Lng: 9.851069665
%VINJERONDE
%#Lat: 61.903755963 Lng: 9.848854914
%STORRONDEN
%#Lat: 61.891556019 Lng: 9.861835046
